﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SIAKADCORE.Models
{
    /// <summary>
    /// Kelas Dosen [dbo].[dosen]
    /// </summary>
    public class Dosen
    {
        #region Constants
        /// <summary>
        /// Konstanta panjang id dari primary key
        /// </summary>
        public const int IdLength = 10;
        /// <summary>
        /// Konstanta prefix dari primary key
        /// </summary>
        public const string IdPrefix = "DSN";
        /// <summary>
        /// Konstanta nama tabel pada database
        /// </summary>
        public const string TableName = "[dbo].[dosen]";
        /// <summary>
        /// Konstanta nama kolom idDosen pada tabel
        /// </summary>
        public const string ColumnNameIdDosen = "[id_dosen]";
        /// <summary>
        /// Konstanta nama kolom namaDosen pada tabel
        /// </summary>
        public const string ColumnNameNamaDosen = "[nama_dosen]";
        /// <summary>
        /// Konstanta nama kolom nip pada tabel
        /// </summary>
        public const string ColumnNameNip = "[NIP]"; 
        #endregion

        #region Fields
        /// <summary>
        /// [id_dosen] CHAR(10) PRIMARY KEY
        /// </summary>
        private string idDosen;
        /// <summary>
        /// [nama_dosen] VARCHAR(50) NOT NULL
        /// </summary>
        private string namaDosen;
        /// <summary>
        /// [NIP] CHAR(25) NOT NULL
        /// </summary>
        private string nip; 
        #endregion

        #region Properties
        /// <summary>
        /// [id_dosen] CHAR(10) PRIMARY KEY
        /// </summary>
        public string IdDosen
        {
            get { return this.idDosen; }
            set { this.idDosen = value; }
        }

        /// <summary>
        /// [nama_dosen] VARCHAR(50) NOT NULL
        /// </summary>
        public string NamaDosen
        {
            get { return this.namaDosen; }
            set { this.namaDosen = value; }
        }

        /// <summary>
        /// [NIP] CHAR(25) NOT NULL
        /// </summary>
        public string Nip
        {
            get { return this.nip; }
            set { this.nip = value; }
        } 
        #endregion

        #region Constructors
        /// <summary>
        /// Konstruktor
        /// </summary>
        public Dosen()
        {

        }

        /// <summary>
        /// Konstruktor
        /// </summary>
        /// <param name="idDosen">[id_dosen] CHAR(10) PRIMARY KEY</param>
        /// <param name="namaDosen">[nama_dosen] VARCHAR(50) NOT NULL</param>
        /// <param name="nip">[NIP] VARCHAR(50) NOT NULL</param>
        public Dosen(string idDosen, string namaDosen, string nip)
        {
            this.idDosen = idDosen;
            this.namaDosen = namaDosen;
            this.nip = nip;
        } 
        #endregion

        public override string ToString()
        {
            return string.Format("ID_DOSEN: {0} | NAMA_DOSEN{1} |NIP_DOSEN: {2}", this.idDosen, this.namaDosen, this.nip);
        }
    }
}
